package Common;

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;

public class Logowanie {
	
private WebDriver driver;
private Utils u;
	
	public Logowanie(WebDriver dd) {
		driver=dd;
		u = new Utils(dd);
	}
	
	public void logujSwd() throws Exception {
		driver.get(Ustawienia.getAdresSZOI());
		
		u.waitForElementPresent(By.name("info"));
		driver.switchTo().frame("info");
		
		
		u.waitForElementPresent(By.name("FFFRAB0520login"));
		u.waitForElementPresent(By.name("FFFRAB0520pasw"));
		u.waitForElementPresent(By.name("sub1"));
		
		driver.findElement(By.name("FFFRAB0520login")).sendKeys(Ustawienia.getKodSWD());
		driver.findElement(By.name("FFFRAB0520pasw")).sendKeys(Ustawienia.getPassSWD());
		driver.findElement(By.name("sub1")).click();
		
	}

}
